package set;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.TreeSet;

public class LinkedHashSetTest {

	public static void main(String[] args) {
		LinkedHashSet<String> linkedHashSet = new LinkedHashSet<>();
		HashSet<String> hashSet = new HashSet<>();
		TreeSet<String> treeSet = new TreeSet<>();

		for (int i = 0; i < 10; i++) {
			linkedHashSet.add("I" + i);
			hashSet.add("I" + i);
			treeSet.add("I" + i);
		}

		System.out.println("linkedHashSet遍历：");
		for (String string : linkedHashSet) {
			System.out.print(string + " ");
		}
		System.out.println();

		System.out.println("hashSet遍历：");
		for (String string : hashSet) {
			System.out.print(string + " ");
		}
		System.out.println();

		System.out.println("treeSet遍历：");
		for (String string : treeSet) {
			System.out.print(string + " ");
		}
	}

}
